# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Dan Serban
# Contributor: Richard Murri

pkgname=python-werkzeug
pkgver=2.3.7
pkgrel=1
pkgdesc='Swiss Army knife of Python web development'
url='https://werkzeug.palletsprojects.com/'
arch=('any')
license=('custom:BSD')
depends=('python-markupsafe')
makedepends=('python-build' 'python-installer' 'python-flit-core')
checkdepends=('python-pytest' 'python-pytest-timeout' 'python-pytest-xprocess' 'python-requests'
              'python-ephemeral-port-reserve' 'python-greenlet' 'python-watchdog'
              'python-cryptography')
source=("https://github.com/pallets/werkzeug/archive/${pkgver}/$pkgname-$pkgver.tar.gz")
sha512sums=('76daba77523f486a56f945f54b9f317589d72e36458d7dce975ae597835de8936242edd6ceafa8913d00021557a9da2acfe9619be562fe7b482858daf84dfd2f')

build() {
  cd "werkzeug-$pkgver"

  python -m build --wheel --no-isolation
}

check() {
  cd "werkzeug-$pkgver"
  PYTHONPATH="src" pytest \
    --deselect=tests/test_serving.py \
    --deselect=tests/test_debug.py::test_basic \
    --deselect=tests/middleware/test_http_proxy.py
}

package() {
  cd "werkzeug-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE.rst -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim:set ts=2 sw=2 et:
